Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
struct System.​Runtime.​InteropServices.​PinnedGCHandle<​T>
Assembly: System.Runtime
Implemented Interfaces
Represents a strongly typed GC handle to a managed object.
Properties
public
bool
IsAllocated
Gets a value that indicates whether this handle has been allocated or not.
public
T
Target
Gets or sets the object this handle represents.
Methods
public
void
Dispose​()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public
bool
Equals​(object obj)
Indicates whether this instance and a specified object are equal.
Returns <code data-dev-comment-type="langword">true</code> if <code data-dev-comment-type="paramref">obj</code> and this instance are the same type and represent the same value; otherwise, <code data-dev-comment-type="langword">false</code> .
obj
The object to compare with the current instance.
public
bool
Equals​(PinnedGCHandle<​T> other)
Indicates whether the current object is equal to another object of the same type.
Returns <code data-dev-comment-type="langword">true</code> if the current object is equal to the <code data-dev-comment-type="paramref">other</code> parameter; otherwise, <code data-dev-comment-type="langword">false</code> .
other
An object to compare with this object.
public static
PinnedGCHandle<​T>
FromIntPtr​(nint value)
Returns a new <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object created from a handle to a managed object.
Returns A new <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object that corresponds to the value parameter.
value
An <see cref="T:System.IntPtr" /> handle to a managed object to create a <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object from.
public
Void*
GetAddressOfObjectData​()
Retrieves the address of object data in a <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> .
Returns <para>The address of first instance field of the pinned object, or <see langword="null" /> if the handle doesn't point to any object.</para>
public
int
GetHashCode​()
Returns the hash code for the current instance.
Returns A hash code for the current instance.
public static
nint
ToIntPtr​(PinnedGCHandle<​T> value)
Returns the internal integer representation of a <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object.
Returns An <see cref="T:System.IntPtr" /> object that represents a <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object.
value
A <see cref="T:System.Runtime.InteropServices.PinnedGCHandle`1" /> object to retrieve an internal integer representation from.
public
string
ToString​()
Inherited from ValueType
Returns the fully qualified type name of this instance.
Returns The fully qualified type name.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .